package com.story.service;

import com.story.spring.StoryApplicationContext;

public class Test {
    public static void main(String[] args) {
        StoryApplicationContext context = new StoryApplicationContext(AppConfig.class);
//        System.out.println(context.getBean("userService"));

        /**
         * UserInterface userService = (UserInterface) context.getBean("userService");
         * 下面这个报错了，因为JDK动态代理，代理的是接口  和  UserService没什么管理，代理的是接口，不是类
         * UserService userService = (UserService) context.getBean("userService");
         */
        UserInterface userService = (UserInterface) context.getBean("userService");
        userService.test();
    }
}
